_require "../../../../basis.smi"
_require "../../../../smlformat-lib.smi"

_require "../../../data/symbols/main/Symbol.smi"
_require "../../../libs/ids/main/LocalID.smi"

structure RecordLayoutCalc =
struct

  type var =
      {path : Symbol.longsymbol, id : VarID.id}

  datatype value =
      VAR of var
    | WORD of Word32.word

  datatype op2 =
      ADD
    | SUB
    | DIV
    | AND
    | OR
    | LSHIFT
    | RSHIFT

  datatype exp =
      VALUE of value
    | OP of op2 * (value * value)

  datatype dec =
      VAL of var * exp

  val format_value : value -> SMLFormat.FormatExpression.expression list
  val format_exp : exp -> SMLFormat.FormatExpression.expression list
  val format_dec : dec -> SMLFormat.FormatExpression.expression list

end
